package com.config;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 全局捕获异常
 * @author L
 *
 */
@ControllerAdvice
public class GlobalDeaultExceptionHander {
	
	@ExceptionHandler(Exception.class)
	@ResponseBody
	public String deafaultExceptionHander(HttpServletRequest request,Exception e){
		System.out.println("捕获异常");
		return "对不起，服务繁忙 稍后再试。";
	} 
}
